@extends('layouts.back_stage')
@section('content')
    <link rel="stylesheet" href="{{env('CDN_DOMAIN_NAME')}}/css/proInfos.css?v0.0.9">
    <style>
        .sel_lab{width:200px;}
        .sale_lab{width:210px;}
    </style>
    <div class="container">
        <div class="pro-btn">
            <h3 style="float:left;">商品档案</h3>
            <a class="btn-a" href="/admin/criterion_size">标准尺码定义</a>
            <a class="btn-a capital" href="javascript:;" style="background:#27c24c;">商品资料</a>
            <a class="btn-a" href="/admin/ProInfos">商品类型</a>
        </div>
        <div>
            <form action="/admin/product_data" method="get" enctype="multipart/form-data">
                <p class="head_p">
                    <label class="sel_lab sale_lab">销售季节：
                        <select class="pro_sel quarter" name="quarter">
                            <option value="">请选择</option>
                            @foreach($season as $k=>$v)
                                <option value="{{ $v}}"
                                        @if($requestInfos['quarter']==$v)
                                        selected
                                        @endif
                                >{{ $v }}</option>
                            @endforeach
                        </select>
                    </label>
                    <label class="sel_lab">品牌：
                        <select class="pro_sel brand" name="brand">
                            <option value="">请选择</option>
                            @foreach($brand_infos as $k=>$v)
                                <option value="{{ $v->id }}"
                                        @if($requestInfos['brand']==$v->id)
                                        selected
                                        @endif
                                >{{ $v->brand_name }}</option>
                            @endforeach
                        </select>
                    </label>
                    <label class="sel_lab">大分类：
                        <select class="pro_sel cat1" name="cate1">

                            @if($requestInfos['cate1'])
                                <option value="{{ $requestInfos['cate1'] }}"> {{ $category[$requestInfos['cate1']] }}</option>
                            @endif
                                <option value="">请选择</option>
                            @foreach($category as $k=>$v)
                                <option value="{{ $k }}">{{ $v }}</option>
                            @endforeach

                        </select>
                    </label>
                    <label class="sel_lab">中分类：
                        <select class="pro_sel cat2" name="cate2">

                            @if($requestInfos['cate2'])
                                <option value="{{ $requestInfos['cate2'] }}"> {{ $categorys[$requestInfos['cate2']] }}</option>
                            @endif
                                <option value="">请选择</option>
                        </select>
                    </label>
                    <label class="sel_lab">小分类：
                        <select class="pro_sel cat3" name="cate3">
                            @if($requestInfos['cate3'])
                                <option value="{{ $requestInfos['cate3'] }}"> {{ $categorys[$requestInfos['cate3']] }}</option>
                            @endif
                                <option value="">请选择</option>
                        </select>
                    </label>
                    <label class="sel_lab" >款号：<input class="pro_sel girard" type="text" autocomplete="off" autocorrect="off" placeholder="款号" value="{{$requestInfos['girard'] }}" name="girard" /></label>
                    <button type="submit" class="btn bt_del btn-info">搜索</button>
                    <a class="btn bt_del btn-info" href="javascript:;" onclick="eliminate()">清空</a>
                </p>
            </form>
        </div>
        <ul class="pro-ul oneFirst">
            {{--商品资料--}}
            <li id="capital" class="pro-li">

                <div class="material-choose">
                    <span>共<span class="info_sum">{{$infos_count}}</span>条信息</span>
                    <a class="btn btn-info bt_a" href="javascript:;" onclick="addInfo()">添加</a>
                </div>
                <div class="material_div">
                    <table class="material" border="1" cellspacing="0" cellpadding="0">
                        <tr>
                            <td>序号</td><td>销售季节</td><td>年份</td><td>季节</td><td>波段</td><td>品牌</td>
                            <td>中分类</td><td>小分类</td><td>款号</td><td>吊牌价/元</td><td>品名</td><td>单位</td><td>操作</td>
                        </tr>
                        <?php $i=1 ?>
                        @foreach($infos as $k => $v)
                            <tr class="trName" abc="{{$v['id']}}">
                                <td><?php echo $loop-$k?></td>
                                <td>{{$v['sale_quarter']}}</td>
                                <td>{{$v['year']}}</td>
                                <td>{{$v['quarter']}}</td>
                                <td>{{$v['band'] or '无波段'}}</td>
                                <td>
                                    @foreach($brand_infos as $kk=>$vv)
                                        @if($v['brand']==$vv->id)
                                            {{$vv->brand_name}}
                                        @endif
                                    @endforeach
                                </td>
                                <td>{{$cate_info[$v['cate2']] or ''}}</td>
                                <td>{{$cate_info[$v['cate3']] or ''}}</td>
                                <td>{{$v['girard']}}</td>
                                <td>{{$v['retail_price']}}</td>
                                <td>{{$v['name']}}</td>
                                <td>{{$v['unit']}}</td>
                                <td class="td_{{$v['id']}} td_a">
                                    <a href="/admin/createProductInfo?id={{$v['id']}}">修改</a>
                                    <a href="javascript:;" onclick="delMaterial({{$v['id']}})">删除</a>
                                </td>
                            </tr>
                            <?php $i++?>
                        @endforeach
                    </table>
                    <div style="float: right;margin:20px 0;"><button class="btn btn-info" onclick="returnPage()" style="float:right;">跳转</button><input type="text" class="form-control returnPage" style="width:6rem;float: right;margin:0 5px;"></div>
                    <span style="float:right;">{{ $infos->appends(['year'=>$requestInfos['year'],'girard'=>$requestInfos['girard'],'quarter'=>$requestInfos['quarter'],'brand'=>$requestInfos['brand'],'cate1'=>$requestInfos['cate1'],'cate2'=>$requestInfos['cate2'],'cate3'=>$requestInfos['cate3']])->links() }}</span>
                </div>
            </li>
        </ul>
        <div class="reference" style="display:none;">
            <div class="reference_header">
                <a href="javascript:;" class="reference_a current">基本信息</a>
                <a href="javascript:;" class="reference_a">颜色规格</a>
                <a href="javascript:;" class="reference_a">面料</a>
                <a href="javascript:;" class="reference_a">辅料</a>
                <a href="javascript:;" class="reference_a">工艺</a>
            </div>
            <ul class="reference_center">
                <li class="reference_li" style="display:block;">
                    <div class="reference_div">
                        <dl><dt>品牌:</dt><dd class="dd1"></dd></dl>
                        <dl><dt>款号:</dt><dd class="dd2"></dd></dl>
                    </div>
                    <div class="reference_div">
                        <dl><dt>年份:</dt><dd class="dd3"></dd></dl>
                        <dl><dt>品名:</dt><dd class="dd4"></dd></dl>
                    </div>
                    <div class="reference_div">
                        <dl><dt>季节:</dt><dd class="dd5"></dd></dl>
                        <dl><dt>吊牌价:</dt><dd class="dd6"></dd></dl>
                    </div>
                    <div class="reference_div">
                        <dl><dt>大分类:</dt><dd class="dd7"></dd></dl>
                        <dl><dt>单位:</dt><dd class="dd8"></dd></dl>
                    </div>
                    <div class="reference_div">
                        <dl><dt>中分类:</dt><dd class="dd9"></dd></dl>
                        <dl><dt>波段:</dt><dd class="dd10"></dd></dl>
                    </div>
                    <div class="reference_div">
                        <dl><dt>小分类:</dt><dd class="dd11"></dd></dl>
                        {{--<dl><dt>性别:</dt><dd class="dd12"></dd></dl>--}}
                    </div>
                    <div class="reference_div">
                        <dl style="width:35%;"><dt>录入人:</dt><dd class="dd15"></dd></dl>
                        <dl style="width:65%;"><dt>录入时间:</dt><dd class="dd16"></dd></dl>
                    </div>
                    <div class="reference_div">
                        <dl style="width:35%;"><dt>修改人:</dt><dd class="dd17"></dd></dl>
                        <dl style="width:65%;"><dt>修改时间:</dt><dd class="dd18"></dd></dl>
                    </div>
                </li>
                <li class="reference_li" style="display:none">
                    <div class="reference_div">
                        <dl><dt>款号:</dt><dd class="dd13"></dd></dl>
                        <dl><dt>尺码组:</dt><dd class="dd14"></dd></dl>
                    </div>
                    <div class="standard_tab" style="height:80%;">
                        <table class="standard" border="1" cellspacing="0" cellpadding="0">
                            <tr><td>颜色</td><td>尺码</td></tr>
                        </table>
                    </div>
                </li>
                <li class="reference_li" style="display:none;">
                    <div class="part_div">
                        <table class="part_tab miantab">
                            <tr class="sizemtr">
                                <td>分类</td><td>大货颜色</td><td>供应商货号</td><td>面料色卡号</td><td>成本价</td><td>门幅</td>
                                <td>尺码</td>
                            </tr>
                        </table>
                    </div>
                </li>
                <li class="reference_li" style="display:none;">
                    <div class="part_div">
                        <table class="part_tab futab">
                            <tr class="sizeftr">
                                <td>分类</td><td>大货颜色</td><td>供应商货号</td><td>面料色卡号</td><td>成本价</td><td>门幅</td>
                                <td>尺码</td>
                            </tr>
                        </table>
                    </div>
                </li>
                <li class="reference_li" style="display:none;">
                    <div class="part_div">
                        <table class="part_tabs gongtab">
                            <tr>
                                <td>颜色</td><td>工艺名称</td><td>标准工价</td><td>单件工价</td>
                            </tr>
                        </table>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    {{--遮罩层--}}
    <div class="mask" style="display:none;"></div>
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/productData.js?v0.1.6"></script>
@endsection
